package zzu.patterns.structural.proxy;

/**
 * jdk动态代理是实现接口,相比于静态代理，只需要该接口类、目标类，而代理类不需要改变
 */
public class JdkClient {
    public static void main(String[] args) {
        //接收用接口类接收，不然会出错
        ISell sellHouse = new ISellHouse();
        ISell proxyInstance = (ISell)new JdkProxy(sellHouse).getProxyInstance();
        System.out.println(proxyInstance);

        proxyInstance.eat();
        proxyInstance.sell();
        proxyInstance.watch();
    }
}
